// class  关键词

// function Person (name) {
//     this.name = name 
// }

// //使用原型在实例间共享方法
// Person.prototype.say = function () {
//     console.log(`hi, my name is ${this.name}`);
// }

// ES6后
 class Person {
     constructor (name) {
         this.name = name
     }

     say () {
         console.log(`hi, my name is ${this.name}`);
     }
 }

 const p = new Person('zce')
p.say()